package com.hq.fxh.No5_User.User.Activity;

import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hq.fxh.CustomerView.switchbutton.SwitchButton;
import com.hq.fxh.No0_ChengQu.Activity.BaseActivity;
import com.hq.fxh.R;
import com.hq.fxh.Utils.LogUtils;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/9/27
 * @Email xlwenhao1858@sina.com
 */


public class MessageSetActivity extends BaseActivity implements View.OnClickListener {
    protected ImageView toolbarImageBack;
    protected LinearLayout toolbarLayoutBack;
    protected TextView toolBarTvTitle;
    protected TextView toolBarTvMore;
    protected LinearLayout toolbarLayoutMore;
    protected LinearLayout toolbarContent;
    protected SwitchButton btnMessageSetXinWen;
    protected SwitchButton btnMessageSetFenSi;
    protected SwitchButton btnMessageSetDianZhan;
    protected SwitchButton btnMessageSetPingLun;

    @Override
    protected void initView() {
        toolbarImageBack = (ImageView) findViewById(R.id.toolbar_image_back);
        toolbarLayoutBack = (LinearLayout) findViewById(R.id.toolbar_Layout_back);
        toolbarLayoutBack.setOnClickListener(MessageSetActivity.this);
        toolBarTvTitle = (TextView) findViewById(R.id.toolBar_tv_Title);
        toolBarTvMore = (TextView) findViewById(R.id.toolBar_tv_More);
        toolbarLayoutMore = (LinearLayout) findViewById(R.id.toolbar_Layout_More);
        toolbarContent = (LinearLayout) findViewById(R.id.toolbar_Content);
        btnMessageSetXinWen = (SwitchButton) findViewById(R.id.btn_messageSet_XinWen);
        btnMessageSetFenSi = (SwitchButton) findViewById(R.id.btn_messageSet_FenSi);
        btnMessageSetDianZhan = (SwitchButton) findViewById(R.id.btn_messageSet_DianZhan);
        btnMessageSetPingLun = (SwitchButton) findViewById(R.id.btn_messageSet_PingLun);

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_message_set;
    }

    @Override
    protected void initData() {
        toolBarTvMore.setVisibility(View.INVISIBLE);
        toolBarTvTitle.setText("消息设置");

        btnMessageSetXinWen.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                LogUtils.startToash(MessageSetActivity.this, b ? "已打开消息通知" : "已关闭消息通知");

            }
        });

        btnMessageSetFenSi.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                LogUtils.startToash(MessageSetActivity.this, b ? "已打开消息通知" : "已关闭消息通知");

            }
        });

        btnMessageSetDianZhan.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                LogUtils.startToash(MessageSetActivity.this, b ? "已打开消息通知" : "已关闭消息通知");

            }
        });

        btnMessageSetPingLun.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                LogUtils.startToash(MessageSetActivity.this, b ? "已打开消息通知" : "已关闭消息通知");

            }
        });

    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.toolbar_Layout_back) {
            finish();

        }
    }
}
